Skip to content

AURA-MCP-02-I2b-S10: consolidated activation readiness (S3-1 closure) - #387

Merged
ste277 merged 1 commit into
mainfrom
feature/aura-mcp-02-i2b-s10-activation-readiness
Nov 24, 2026
Merged

ste277 merged 1 commit into
mainfrom
feature/aura-mcp-02-i2b-s10-activation-readiness

Conversation

@ste277

@ste277 ste277 commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Disabled-by-default MCP OAuth code only. No activation, deployment, env/credential change or gate change. MCP stays disabled; staging and Production activation stay on HOLD. Do not merge without owner approval.

Full report: AURA_MCP_02_I2B_S10_ACTIVATION_READINESS_REPORT.md (in this PR).

What changes

S3-1: cross-instance code safety (closed in code)

  • Activation is now a held transaction (heldStatement / beginIssuedActivation). The UPDATE runs before the response is written, and the COMMIT is sent only after the complete response has been handed off (finish, same status < 400, still carrying the code).
  • Every other outcome leaves the code pending in the shared database with no further write. The connection is dropped or idle_in_transaction_session_timeout ends it, and PostgreSQL rolls back. This covers activation failure, a database outage, a disconnect, a partial write, a replaced response (S7 P3) and a crash or freeze.
  • An ambiguous COMMIT can only happen after hand-off: the code is "issued, outcome unknown", and both outcomes are safe.
  • Code lookups use FOR SHARE, so a racing redemption waits for the activation instead of reading a half-decided row. consume refuses pending codes at the database level.
  • The S8 instance-local hold, the background retry and the inline revocation are removed.

Secrets (I2b-R-6 compatibility)

  • Strength is format-aware: hex counts 4 bits per character and base64/base64url 6. This sits on top of the unchanged S8 rule, with repeated-block, run and skew vetoes.
  • openssl rand -hex 16 was refused 100% of the time by S8; -base64 24 about 1 time in 6,600. Both are now accepted for every role, including retained cookie keys.
  • Nothing S8 accepted is newly refused (28,733 samples plus the fixtures).

Time budget

  • One deadline now covers checkout, statement and COMMIT; S8 restarted the clock at COMMIT.
  • requestBudgetMs (default 5000 ms) caps all store calls of one authorization-server request.

Concurrency (CI run 45372768632, 188 of 480)

  • Root cause: the harness was coupled to runner speed and met fail-closed load shedding. It is not a limiter defect, and it is reproduced locally.
  • The aggregate test is split into unconditional safety (admitted ≤ counted ≤ G), exactness under an explicit budget, and a slow-database reproduction. Concurrency is unchanged and no assertion is weakened.

Evidence (isolated PostgreSQL 16, socket only, synthetic identities)

  • All 14 MCP suites pass. New suites: mcpOAuthS10 (121) and mcpOAuthS10Db (21). Both are wired into CI.
  • S10Db proves every abandonment path stays pending and is refused on another instance, even with the server-captured code and the correct verifier. That includes partial delivery where the code bytes reached the socket, and a frozen process (server timeout rollback, plus a fresh "restarted" store).
  • Mutation tests:
    • committing before the write fails A4, A5, I2 and I4;
    • removing FOR SHARE fails I4.
  • Repeats: S10Db 5/5, S6Db 5/5 and StagingBlockersDb 8/8 green (after correcting a too-strict new safety check, which exposed the documented ambiguous-COMMIT over-count).
  • The gate and deploy files are unchanged (git diff b2e0f8c is empty for mcpAuthGate.ts, mcpRemoteReadiness.ts, vercel.json, the OAuth route, /api/mcp, next.config.js and the standalone check).

Still required (see report §6 and §8)

Live validations V1–V6, each separately authorized:

  • V1: trusted edge headers.
  • V2: Neon pooler and the held transaction.
  • V3: multiple instances.
  • V4: controlled load.
  • V5: audit-key cutover.
  • V6: the post-response COMMIT completes on Vercel.

Owner decisions D2–D10 also remain.

🤖 Generated with Claude Code

Disabled-by-default MCP OAuth code only; activation gates unchanged.

- S3-1: authorization-code activation is a held transaction COMMITTED
  only after the complete response was handed off. Every other outcome
  (activation failure, database outage, disconnect, partial write,
  replaced response, crash/freeze) leaves the code PENDING in the shared
  database with no further write -- refused on every instance. Lookups
  of codes use FOR SHARE; consume refuses pending codes. The S8
  instance-local hold, background retry and inline revocation are removed.
- Secrets: format-aware strength (hex 4 bits/char, base64/base64url
  6 bits/char) on top of the unchanged S8 rule, with repeated-block / run /
  skew vetoes. openssl rand -hex 16 and -base64 24 are accepted for every
  role incl. retained cookie keys; nothing S8 accepted is newly refused.
- Time budget: one deadline covers checkout + statement + COMMIT; one
  per-request budget (requestBudgetMs, default 5000 ms) caps all store
  calls of an authorization-server request.
- CI 45372768632 (188/480): harness coupled to runner speed meeting
  fail-closed load shedding; split into unconditional safety (admitted <=
  counted <= G) and exactness under an explicit budget, plus a slow-DB
  reproduction. Same concurrency, no weakened assertion.

Tests: new mcpOAuthS10 (121) and mcpOAuthS10Db (21), wired into CI;
S6/S8/Postgres/StagingBlockers DB suites updated. Report:
AURA_MCP_02_I2B_S10_ACTIVATION_READINESS_REPORT.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
aura-updated Ready Ready Preview Nov 24, 2026 1:08pm UTC

@ste277
ste277 merged commit a724997 into main Nov 24, 2026
9 checks passed

This branch was successfully deployed

1 active deployment
Preview — 85383257 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant